package com.sline.test;

import java.io.File;

public class DirectoryPrint {
    public static void main(String[] args) {
        File dir = DirectorySize.getFile();

        printDir(dir, 0);
    }

    public static void printDir(File dir, int level) {
        File[] subFiles = dir.listFiles();

        for (File subfile: subFiles) {
            for (int i = 0; i < level; i++) {
                System.out.print("\t");
            }

            System.out.println(subfile.getName());

            if (subfile.isDirectory()) {
                printDir(subfile, level + 1);
            }
        }
    }
}
